// import React from 'react';
// import ReactDOM from 'react-dom';

import React from './lib/react';
import ReactDOM from './lib/react-dom';


class Counter extends React.Component {

  constructor(props) {
    super(props);
    this.state = { list: ['A', 'B', 'C', 'D', 'E', 'F'] };
  }
  handleUpdate = () => {
    this.setState({
      list: ['A', 'C', 'E', 'B', 'G']
    })
  }
  render() {
    return (
      <div>
        <ul>
          {
            this.state.list.map(item => <li key={item}>{item}</li>)
          }
        </ul>
        <button onClick={this.handleUpdate}>update</button>
      </div>
    )
  }
}


ReactDOM.render(
  <Counter />,
  document.getElementById('root')
);

// 注意如果要使用老的把 jsx 编译成 React.createElement(), 必须在启动项中设置 cross-env DISABLE_NEW_JSX_TRANSFORM=true
// 如： "start": "cross-env DISABLE_NEW_JSX_TRANSFORM=true react-scripts start",